fix(transcription): survive a recognizer panic instead of killing the worker#8
Open
farce1 wants to merge 1 commit into
Open
fix(transcription): survive a recognizer panic instead of killing the worker#8farce1 wants to merge 1 commit into
farce1 wants to merge 1 commit into
Conversation
… worker A Rust panic inside the Whisper recognizer's transcribe call unwound the worker thread, ending transcription for the rest of the meeting (the forwarder then marks it degraded). Wrap the call in catch_unwind so a single bad chunk is skipped and the worker keeps going. Mirrors Handy's catch_unwind-around-the-engine practice.
This was referenced Jun 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
If
WhisperRecognizer::transcribeever panics (a Rust panic inside the sherpa-rs binding — e.g. on unexpected output), the panic unwinds the transcription worker thread. The forwarder then sees the result channel disconnect and marks the session transcription-degraded — so a single bad chunk silently ends transcription for the entire rest of the meeting.Fix
Wrap the ASR call in
catch_unwind(catch_panichelper): a panicking chunk is logged and skipped, and the worker keeps processing subsequent audio. This mirrors Handy's documented "catch_unwind around the engine" practice. The happy path is byte-identical (Some(result)); only the panic path changes.Verification (TDD)
catch_panictests (Someon success,Noneon panic).clippy --all-targets --all-features -- -D warnings✅; fullcargo test→ 2 new tests pass, only the pre-existingmodel_archive_consts_tests(REPLACE_WITH_placeholders) fail.Notes
process_completed_segments+ adds#[cfg(test)] mod tests, so it will conflict with fix(transcription): persist real segment end times, not a fixed 1s span #4 and fix(transcription): resample from the real capture sample rate #6 inworker.rs— resolve by combining (they edit different parts of the same function/file).Uncommitted
vendor/vc_redist.x64.exe+REPLACE_WITH_SHA256/pubkey placeholders. Verified locally with a temp untracked vendor placeholder. Code-only, no new deps.